package com.huaxin.hxmoduleworkorder.common.validator;

import com.huaxin.hxmoduleworkorder.common.annotation.validation.ValidMaintenanceOrderOperatorRole;
import com.huaxin.hxmoduleworkorder.common.enums.MaintenanceOrderOperatorRole;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class MaintenanceOrderOperatorRoleValidator implements ConstraintValidator<ValidMaintenanceOrderOperatorRole, String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return value == null || MaintenanceOrderOperatorRole.isValid(value);
    }
}
